package cc.plumgo.ss.core;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

import cc.plumgo.j2me.utils.CustomCanvas;

public class SchoolMidlet extends MIDlet {
	private static CustomCanvas mainCanvas;
	public static SchoolMidlet midlet;
	
	public SchoolMidlet() {
		super();
		midlet = this;
	}
	protected void destroyApp(boolean unconditional)
			throws MIDletStateChangeException {
		mainCanvas.stop();
	}

	protected void pauseApp() {
		mainCanvas.stop();
	}

	protected void startApp() throws MIDletStateChangeException {
		try {
			mainCanvas = new MainCanvas();
		} catch (Exception e) {
			e.printStackTrace();
		}
		Display.getDisplay(this).setCurrent(mainCanvas);
	}
}
